import request from "@/utils/request";

// 查询入库单列表
export function listCheck(query) {
  return request({
    url: "/system/notice/index",
    method: "post",
    data: JSON.parse(JSON.stringify(query)),
  });
}
//根据id查询单个入库单
export function getCheckById(warehousingEntryId) {
  return request({
    url: "/system/notice/add/" + warehousingEntryId,
    method: "get",
  });
}
//删除入库单表
export function deleteWh(warehousingEntryId) {
  return request({
    url: "/system/notice/delete/" + warehousingEntryId,
    method: "delete",
  });
}
//新增入库单
export function addWh(WhWarehousing) {
  return request({
    url: "/system/notice/add", // 假设这是新增记录的API端点
    method: "post",
    data: JSON.parse(JSON.stringify(WhWarehousing)),
  });
}
//修改请求
export function updateWh(WhWarehousing) {
  return request({
    url: "/system/notice/update", // 假设这是修改记录的API端点
    method: "put", // 或者使用 "patch" 取决于后端API的要求
    data: JSON.parse(JSON.stringify(WhWarehousing)),
  });
}
//根据id查询物品明细表

export function selectDetails(warehousingEntryId) {
  return request({
    url: "/system/notice/whdetailed",
    method: "post",
    data: JSON.parse(JSON.stringify(warehousingEntryId)),
  });
}

export function DeleteDetail(detailedId) {
  return request({
    url: "/system/notice/" + detailedId,
    method: "delete",
  });
}
//明细删除按钮
function handleDeleteDetail(detailedId) {
  DeleteDetail(detailedId).then(() => {
    //执行查询
    getDetail();
    proxy.$modal.msgSuccess("删除成功");
  });
}
